Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Using an extract program for a node
This section explains the requirements and precautions to take when you use an extract program to populate a dynamic TreeView’s nodes from an extraction program.
The extraction procedure mechanism was designed to allow developers to extract complex data from the database by allowing them to execute a procedure on an OpenEdgeŽ AppServer and send this back to the client side, indicating that the extraction program is dependant on being connected to a database, and the database tables could be directly referenced.
This example uses the customer table from the Sports2000 database.
To create an extraction procedure, you can create a new structured PLIP from the AppBuilder menu, as shown in Figure 9–7, or add a procedure to an existing structured PLIP.
Figure 9–7: New dialog box
![]()
In this PLIP you must add a procedure called loadData, shown in Figure 9–8.
Figure 9–8: Procedure loadData
![]()
This procedure accepts three input parameters and one input-output table handle to get and send the temp-table that is responsible for creating the nodes on the TreeView.
For this example, the extract program is run for the root node of the TreeView and it will return the first 10 customers in the database. The procedure will look as follows:
Parameters
pcParentNodeKeyIf the node level being created is a child of another node, this parameter will contain the unique identifier of its parent node. If the node being created is the Root node, it will be blank. This value must be assigned to the new record’s
parent_node_keyto ensure that the build routine knows where to put this node.pcPrimarySDOSince an SDV needs a data source—normally in an SDO you must tell it what SDO is to be launched to allow this functionality. This SDO must contain the tables used in your extraction procedure and must have—as the first table in its query—the table whose
ROWIDwas stored in therecord_rowidfield. This value can be assigned to theprivate_datafield of the new record being created.pcFilterValueIf a filter viewer is used on your dynamic TreeView the value being passed from the filter viewer will be received through this parameter. You must dissect this field if you want to use these values in your query.
phTableThis is the temp-table’s handle used to populate the TreeView with its nodes. You can use this handle to query any existing records in the TreeView as well as adding new records for nodes to be created. If your extract procedure is not the root node in the dynamic TreeView, you must find the parent node record using the
pcParentNodeKeyvalue. You either get the value from therecord_reffield, which is the table’s key field, or use therecord_rowidto find your parent record and the only filter on its values when building its child nodes.As you can see from the example provided, you must populate the following fields:
Caution: When assigning the value of therecord_reffield, you must make sure that you specify the value of the entity key field/entity object field as specified ingsc_entity_mnemonictable. If you do not, an incorrect record in the SDO is selected. When creating a node record, be sure that you specify a valid SDO name in the Primary SDO field to accompany your extract program.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |